eststo clear
capture drop sample
gen sample=(n_ud==1 & S_pds==1 & (VF==1 | (VF==0 & sh_buy_sp_nonVF>=0.2 )))	 

local OUT ln_p_sbjo w_r ln_mc_o_B ln_mu_o_B
foreach o of local OUT{
eststo: reghdfe `o'   T    age_buy_month age_buysel_month     ln_p_inpf_sbjo ln_q_sbjo    if sample==1  ///
, abs(gr_sjt  b_id cohort_sb) vce (cluster by) // 
  quietly estadd local FE ="sjt,b", replace 
    quietly estadd local CTRL ="\scriptsize{R,O}", replace  
}
*
esttab using "${tables}\TableC7.tex", ///  
  label replace booktabs b(3) se(3) noconstant obslast substitute(\_ _) ///
  title("A Change in Sourcing Strategy - VF's Case" \label{VFCaseTab}) /// 
  drop(  age_buysel_months age_buy_months  ln_q_sbjo ln_p_inpf_sbjo _cons )  /// 
  stats(FE  CTRL r2   N   , fmt( %~#s   %~#s  2 %12.0fc  )  ///
  labels("FEs" "Controls" `"\(R^{2}\)"'  "Obs."  ))   ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  nonotes  
  